

  <div style="margin:1% 5%;">
    <div class="layui-form-item" style=";padding-left: 30%;">

      <div class="layui-input-inline">
        <input type="text" id="macfjval" placeholder="请输入房间号/mac地址/ip" autocomplete="off" class="layui-input">

      </div>
      <label class="layui-form-label" style="padding: 0!important;"><button type="button" class="layui-btn" id="btnSearch" lay-event="shousuo">搜索</button></label>
    </div>
  </div>

  <!--<div id="demo1"></div>-->
</div>
  <div style="padding-left: 50px;">
    <caption style="margin-left: 40px;"><span >
                <button type="button" class="btn btn-primary layui-btn"  onclick="method5('tableExcel')">
                    <span class="glyphicon glyphicon-folder-open">导出Excel</span>
                </button>
            </span>
    </caption>
  </div>
<script type="text/html" id="tol">
  <div>
    <div style="float:left;">解绑列表</div>
    <div style="float:right;margin-right: 50px">共有数据：<span id="count"></span>条</div>
  </div>

</script>
<table class="layui-table" id="data2" lay-filter="data2">

</table>

<script>

  var local_store = layui.data("local_store");
  var local = local_store.token;
  $.ajax({
    type:"get",
    url:"/admin/station/query/stationLoginQuanxXian?stationId="+json.id,
    dataType: "json",
    contentType:"application/json;charset=utf-8",
    beforeSend: function(request) {
      request.setRequestHeader("token", local);
    },
    success:function (res) {
      if(res.code==500){
        alert("权限不足")
        location="../../admin/main.html";
        return
      }}})
  function GetRequest() {
    var url = decodeURI(location.search); //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
      var str = url.substr(1);
      strs = str.split("&");
      for(var i = 0; i < strs.length; i ++) {
        theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
      }
    }
    return theRequest;
  }

  var pages= localStorage.getItem('page');
  var json=GetRequest();
  layui.use('table', function(){
    var table = layui.table;

    table.render({
      elem: '#data2'
      ,  id: "t"
      ,  toolbar:"#tol"
      , method: 'post'
      ,url:'/admin/terminal/queryIpMacFjAll?terminalStation='+json.id
      ,cols: [[
        {field:'terminal_id', title: '终端编号',
          align: "center"}
        ,{field:'terminal_ip', title: 'IP地址',
          align: "center"}
        ,{field:'terminal_mac',
          align: "center", title: 'MAC地址'}
        ,{field:'terminal_key',
          align: "center",  title: '密码'}
        ,{field:'station_bh', title: '站点编号',
          align: "center"} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
        ,{field:'terminal_room',
          align: "center", title: '房间号'}
        ,{field:'terminal_line',
          align: "center",  title: '是否在线'}
        ,{field:'group_name',
          align: "center", title: '所属分组'}
        ,{field:'terminal_version_code',
          align: "center", title:'版本'}
        ,{field:'terminal_system_model',
          align: "center", title: '型号'}

      ]],page:{
        curr:pages
      },
      done: function(res, curr, count){
        localStorage.setItem('page',curr);
        $("#count").html(count);
      }
    });

    $("#btnSearch").click(function(){
      table.reload("t",{
        where:{
          macfj:$("#macfjval").val()
        },
        page:{
          curr:1
        }
      });
    });
  });

</script>
